import {ReceiverA, ReceiverB, ReceiverC} from './Receivers';

interface ICommand{
  commandName:string;
  execute():void
}

class BarCommand implements ICommand{
  commandName:string = 'Bar';
  execute():void{
    console.log(`下达命令：${this.commandName}`);
    let recA = new ReceiverA();
    let recB = new ReceiverB();
    recA.actionFirst();
    recA.actionSecond();
    recB.methodFirst();
    recB.methodSecond();
  }
}

class FooCommand implements ICommand{
  commandName:string = 'Foo';
  execute():void{
    console.log(`下达命令：${this.commandName}`);
    let recC = new ReceiverC();
    recC.stepOne();
    recC.stepTwo();
  }
}

export {ICommand, FooCommand, BarCommand};